home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_01_07 / 1n07050a < prev    next >
Text File  |  1990-11-03  |  2KB  |  97 lines

  1.  
  2.  
  3. ;********************************************************
  4. ;* NBLIBA.ASM -- NETBIOS related assembly language code.
  5. ;*
  6. ;*    Copyright 1990 Tom Jensen
  7. ;********************************************************
  8.  
  9. DGROUP    GROUP    _DATA,STACK
  10.     ASSUME    CS:_TEXT,DS:DGROUP,SS:DGROUP
  11.  
  12. _DATA    SEGMENT WORD PUBLIC 'DATA'
  13.     EXTRN    _IFlag:WORD
  14. _DATA    ENDS
  15.  
  16. STACK    SEGMENT PARA STACK 'STACK'
  17. STACK    ENDS
  18.  
  19. _TEXT    SEGMENT WORD PUBLIC 'CODE'
  20.  
  21. ;********************************************************
  22. ;* NbCall -- Execute a NETBIOS call.
  23. ;*
  24. ;*  Entry:  ncb  = pointer to Network Control Block
  25. ;********************************************************
  26.  
  27.     PUBLIC    _NbCall
  28. _NbCall PROC    NEAR
  29.     push    bp
  30.     mov    bp,sp
  31.     push    es
  32.  
  33.     mov    bx,[bp+4]    ;Load es:bx with ncb
  34.     mov    ax,ds        ;Assumes small model
  35.     mov    es,ax
  36.     int    5Ch        ;Call NETBIOS
  37.     and    ax,0FFh     ;isolate error code (al)
  38.  
  39.     pop    es
  40.     pop    bp
  41.     ret
  42. _NbCall ENDP
  43.  
  44. ;********************************************************
  45. ;* IPost -- General purpose Post routine for NETBIOS
  46. ;*
  47. ;*  Not called directly, interrupt service routine
  48. ;********************************************************
  49.  
  50.     PUBLIC    _IPost
  51. _IPost    PROC    NEAR
  52.     push    ax
  53.     push    ds
  54.  
  55.     mov    ax,DGROUP
  56.     mov    ds,ax
  57.     mov    ax,1
  58.     mov    _IFlag,ax
  59.  
  60.     pop    ds
  61.     pop    ax
  62.     iret
  63. _IPost    ENDP
  64.  
  65. ;********************************************************
  66. ;* SetPostAddr -- Store address of post routine in NCB
  67. ;*          and clear post interrupt flag.
  68. ;*
  69. ;*  Entry:  Far pointer to Post address within NCB
  70. ;********************************************************
  71.  
  72.         PUBLIC    _SetPostAddr
  73. _SetPostAddr    PROC    NEAR
  74.     push    bp
  75.     mov    bp,sp
  76.     push    es
  77.  
  78. ;    Load es:bx with post addr
  79.     les    bx,[bp+4]
  80.  
  81. ;    Store address of _IPost
  82.     lea    ax,cs:_IPost
  83.     mov    es:[bx],ax
  84.     mov    ax,cs
  85.     mov    es:[bx+2],ax
  86.  
  87.     mov    _IFlag,0    ;Clear interrupt flag
  88.  
  89.     pop    es
  90.     pop    bp
  91.     ret
  92. _SetPostAddr    ENDP
  93.  
  94. _TEXT    ENDS
  95.     END
  96.  
  97.